#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
#include<string.h>
void my_strncat(const char* name, char* str, int n);
int main()
{
	char name[20] = "abcd";
	char str[20] = "def";
	int n = 2;
	my_strncat(name, str, n);
	printf("%s", str);
	return 0;
}
void my_strncat(const char* name, char* str, int n)
{
	int i = 0;
	while (*(str + i) != '\0')
		i++;
	int j = 0;
	for (j = 0; j < n; j++)
	{
		*(str + i + j) = *(name + j);
	}
	*(str + i + j) = '\0';
}